﻿using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using UserManagementService;

namespace UsernameCheck
{
    [WebService(Namespace="http://mycompany.org")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    // The following attribute allows the service to 
    // be called from script using ASP.NET AJAX.
    [System.Web.Script.Services.ScriptService]
    public class ValidateUsername : System.Web.Services.WebService
    {
        public ValidateUsername()
        {
 
        }

        [WebMethod]
        public bool Validate(string str)
        {
            UserManagementServiceClient client = new UserManagementServiceClient();
            bool valid = client.availableUserName(str);
            client.Close();
            return valid;
        }

    }
}